<template>
  <canvas class="star-sky" id="star-sky"></canvas>
</template>

<script>
import startSky from './startSky.js'
export default {
  title: '流星天空',
  mounted() {
    this.init()
    window.addEventListener('resize', this.init)
  },
  beforeDestroy() {
    startSky.destroy()
    window.removeEventListener('resize', this.init)
  },
  methods: {
    init() {
      startSky.init('star-sky')
    }
  }
}
</script>

<style lang="scss" scoped>
.start-sky {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: black;
}
</style>
